package ch12.bad;

import util.Fmt;

interface NameAble {
    String getName();
}

class Person implements NameAble {
    private String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    public void walk() {
        Fmt.printf("%s is walking.", name);
    }

}

class School {
    public static NameAble getNameAble() {
        return new Person("New Employee");
    }
}

public class Main {
    public static void main(String[] args) {
        NameAble n = School.getNameAble();
        Person p = (Person) n;
        p.walk();
    }
}
// New Employee is walking.
